<?
include 'includes/specs_functions.php';
echo printGoogleAnalytics();

$specId = $_POST['specId'];

if(isset($_POST['specId'])){

	$output .= "
			<script type='text/javascript'>
				$(function(){
					$('.spec_avg').children().not(':radio').hide();
					$('.spec_avg').stars({
						disabled: true
					});
				});
				
				var mustLoad = true;
				$(document).ready(function(){
					$(function() {
						$('#show_spec_popup').draggable({cancel: '#spec_popup_body'});
					});
				});
				$('#spec-snapshot').click(function(e) {	
					showSpecPop(1);
				});
		</script>
		<div id='show_spec_popup'></div>
		<div><img id='spec-snapshot' class='cur-point' src='specs/media/specImages/".$specId.".png?".time()."' style='height: 239px;padding-top: 15px;padding-left: 28px;'/></div>
		<script>
				function showSpecPop(toggle) {
					if(toggle=='1'){
						if(mustLoad){
							$('#show_spec_popup').load('specs/php/showSpecImage.php', addPadSessionVars({sId: ".$specId."}));
							mustLoad = false;
						}
						$('#show_spec_popup').css('top', (($(window).height() - $('#show_spec_popup').outerHeight()) / 2) + $(window).scrollTop() + 'px');
						$('#show_spec_popup').css('left', (($(window).width() - $('#show_spec_popup').outerWidth()) / 2) + $(window).scrollLeft() + 'px');
						$('#show_spec_popup').fadeIn('fast');
					}else{
						$('#show_spec_popup').fadeOut('fast');
					}
				};
		</script>";	
}

echo $output;

?>
